package net.yyge;

import net.yyge.apksigner.signer.CertCreator;
import net.yyge.apksigner.signer.utils.DistinguishedNameValues;

import java.io.File;

public class Test {

    public static void main(String[] args) {
        createSign("test","123456789");
    }


    public static void createSign(String alias, String password) {
        File file = new File("out/");
        if (!file.exists()) {
            file.mkdir();
        }
        File signFile = new File(file, alias + ".jks");

        DistinguishedNameValues distinguishedNameValues = new DistinguishedNameValues();
        String test = "test";
        distinguishedNameValues.setCountry(test);
        distinguishedNameValues.setState(test);
        distinguishedNameValues.setLocality(test);
        distinguishedNameValues.setStreet(test);
        distinguishedNameValues.setOrganization(test);
        distinguishedNameValues.setOrganizationalUnit(test);
        distinguishedNameValues.setCommonName(test);
        CertCreator.createKeystoreAndKey(
                signFile,
                password.toCharArray(),
                alias,
                distinguishedNameValues);
    }


}
